﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace hoangnam12
{
    public partial class SiteMaster : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["login"] != null)
            {
                lblLogin.Text = "Welcome " + Session["login"];
                lblLogin.Visible = true;
                LinkButton1.Text = "Đăng Xuất";
                LinkButton2.Visible = false;
            }
            else
            {
                lblLogin.Visible = false;
                LinkButton1.Text = "Đăng Nhập";
            }
        }

        protected void LinkButton1_Click(object sender, EventArgs e)
        {
            if (LinkButton1.Text == "Đăng Nhập")
            {
                Response.Redirect("DangNhap.aspx");
            }
            else
            {
                
                Session.Clear();
                Response.Redirect("Default.aspx");
            }
        }

        protected void LinkButton2_Click(object sender, EventArgs e)
        {
            
            Response.Redirect("DangKy.aspx");
        }

        protected void DataList1_SelectedIndexChanged(object sender, EventArgs e)
        {

        }

        protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
        {
            Response.Redirect("Search.aspx");
        }

     
    }
}
